package com.heima.es.service.impl;

import com.heima.es.pojo.Result;
import com.heima.es.service.SearchService;
import com.heima.es.utils.ElasticUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
public class SearchServiceImpl implements SearchService {

    @Autowired
    ElasticUtils elasticUtils;

    @Override
    public Result searchPageInfo(Integer page, Integer size, String keyword) {
        try {
            return elasticUtils.searchPageInfo(page, size, keyword);
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
}
